package com.hqd.jjvm.instructions.reserve;

import com.hqd.jjvm.instructions.AbstractInstruction;
import com.hqd.jjvm.instructions.InstructionType;
import com.hqd.jjvm.jnative.JNativeFunction;
import com.hqd.jjvm.jnative.JNativeRegistryFactory;
import com.hqd.jjvm.rtda.JThread;
import com.hqd.jjvm.rtda.heap.JMethod;

public class ReserveInstruction extends AbstractInstruction {

    public ReserveInstruction(JThread jThread) {
        super(jThread);
    }

    @Override
    public void execute(InstructionType instructionType) {
        JMethod jMethod = getJMethod();
        JThread jThread = getJThread();
        switch (instructionType) {
            case BREAKPOINT: {
                break;
            }
            case IMPDEP1: {
                JNativeFunction jNativeFunction = JNativeRegistryFactory.getInstance(jMethod);
                jNativeFunction.invoke(jThread);
                break;
            }
            case IMPDEP2: {
                break;
            }
        }
    }
}
